import { NetWorkConfig } from './network.config';
// import axios from 'axios';
const axios = require('axios');
const BASE_URL = NetWorkConfig.BackendUrl + ':' + NetWorkConfig.BackendPort+'/data-warehouse'

// 搜索参数
export class GasUseDataSearchArgs{
  constructor(){
    this.GasSerialId='';
    this.GasId='';
  }
}

export class GasCheckDataSearchArgs{
  constructor(){
    this.GasId='';
  }
}
export class GasRecordDataSearchArgs{
  constructor(){
    this.GasId='';
  }
}


export async function searchUseDataDetail(
  args=new GasUseDataSearchArgs()
){
  try{
    const res=await axios({
      method:'get',
      url:BASE_URL+'/use-data-detail',
      params:{
        ...args
      },
      withCredentials:false
    })
    return res;
  }
  catch(error){
    console.error(error)
  }
}
export async function searchCheckDataList(
  args=new GasCheckDataSearchArgs()
){
  try{
    const res=await axios({
      method:'get',
      url:BASE_URL+'/check-data-list',
      params:{
        ...args
      },
      withCredentials:false
    })
    return res;
  }
  catch(error){
    console.error(error)
  }
}
export async function searchReocrdDataList(
  args=new GasRecordDataSearchArgs()
){
  try{
    const res=await axios({
      method:'get',
      url:BASE_URL+'/record-data-list',
      params:{
        ...args
      },
      withCredentials:false
    })
    return res;
  }
  catch(error){
    console.error(error)
  }
}